package nftrainer.helper;

import java.util.ArrayList;
import java.util.Collections;


public class NFMap {
	
	private ArrayList<String> keys, values, all;
	private String allAsString;
	
	public NFMap () {
		keys = new ArrayList<String>();
		values = new ArrayList<String>();
		all = new ArrayList<String>();
	}
	
	public void setKeys(ArrayList<String> keys) {
		this.keys = keys;
	}
	
	public void addToKeys(String key) {
		this.keys.add(key);
	}
	
	public void setAll(ArrayList<String> all) {
		this.all = all;
	}
	
	public void addToAll(String all) {
		this.all.add(all);
	}
	
	public void setValues(ArrayList<String> values) {
		this.values = values;
	}
	
	public void addToValues(String value) {
		this.values.add(value);
	}
	
	public ArrayList<String> getKeys() {
		Collections.sort(keys);
		return this.keys;
	}
	
	public ArrayList<String> getValues() {
		Collections.sort(values);
		return this.values;
	}
	
	public ArrayList<String> getAll() {
		return this.all;
	}
	
	public String getAllAsString() {
		allAsString = new String();
		for (int i = 0; i < all.size(); i++) {
			if (i == 0) {
				allAsString+=all.get(i);
			} else {
				allAsString+=", "+all.get(i);
			}
		}
		return allAsString;
	}
	
	@Override
	public boolean equals(Object o) {
		if (!(o instanceof NFMap)) {
			return false;
		}
		NFMap other = (NFMap) o;
		if (this.getKeys().equals(other.getKeys()) && this.getValues().equals(other.getValues())) {
			return true;
		}
		return false;
	}

}
